package com.asset.mapper;

import com.asset.model.entity.DepDetail;
import com.asset.model.entity.DepreciationDetail;
import com.asset.model.entity.DepreciationRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DepreciationMapper {

    void update(@Param("depreciationDetail") DepreciationDetail depreciationDetail);

    //获取记录信息中资产累计折旧金额最高的折旧明细
    List<DepDetail> getMaxCumulativeDepreciation();

    //找到资产上次自动折旧后的累计折旧信息
    DepreciationDetail getNewDetail(@Param("maxDep") DepDetail maxDep);

    //返回资产对应的折旧信息
    List<DepreciationRecord> getRecordByAssetId(@Param("assetId") Integer assetId);

    void insertDepreciationRecord(@Param("depreciationRecord") DepreciationRecord depreciationRecord);

    Integer getMaxId();

    List<DepreciationDetail> getDetailByRecordId(Integer recordId);


    List<DepreciationRecord> getRecordByCompanyId(@Param("companyId") Integer companyId);

    List<DepreciationRecord> getRecordByCompanyIdSys(@Param("companyId")Integer companyId);

    //批量插入折旧明细
    void updateDepreciationDetail(@Param("depreciationDetails")List<DepreciationDetail> depreciationDetails,@Param("recordId")Integer recordId);

    //逻辑删除记录表
    void tombstoneRecord(@Param("recordId")Integer recordId);


}
